Skip to content

[WIP] Oneshot Callbacks#1244

Closed
kylesayrs wants to merge 7 commits intomainfrom
kylesayrs/oneshot-callbacks
Closed

[WIP] Oneshot Callbacks#1244
kylesayrs wants to merge 7 commits intomainfrom
kylesayrs/oneshot-callbacks

Conversation

@kylesayrs
Copy link
Collaborator

@kylesayrs kylesayrs commented Mar 12, 2025

Purpose

  • Standardize oneshot callbacks and prepare for oneshot pipeline extraction

Changes

  • Implement the sequential_epoch_end callback event which should be called after one sequential layer has been calibrated with one epoch
    • Add callback event to sequential and layer_sequential pipelines
  • Trigger module compression both on the SEQUENTIAL_EPOCH_END event as well as on finalize
  • Prepare smoothquant for pipeline extraction
    • Replace uses of _hf_hook. pre_forward with align_module_device for clarity
    • Specify resolved_mappings_ type hint for clarity
    • Trigger _apply_smoothing on the SEQUENTIAL_EPOCH_END as well as on finalize
    • Add a guard which allows the _apply_smoothing function to be called multiple times per session (as is required by sequential pipeline)

Testing

  • Cannot test since cannot call events before initialization

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@github-actions
Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
@kylesayrs kylesayrs mentioned this pull request Mar 25, 2025
@kylesayrs
Copy link
Collaborator Author

Closing because, due to an initialization check in compression lifecycle, these changes depend on #1279

@kylesayrs kylesayrs closed this Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant